const express=require('express')
const router=express.Router()

//用户路由处理函数对应的中间件
const handler=require('../router_handler/medicine')
//导入验证数据中间件
const expressJoi=require('@escook/express-joi')
const {med_find_schema,med_schema,med_update_schema,delete_schema}=require('../schema/medicine')

router.post('/findall',handler.medicineall)
router.post('/insert',expressJoi(med_schema),handler.medicineinsert)
router.post('/delete',expressJoi(delete_schema),handler.medicinedelete)
router.post('/update',expressJoi(med_update_schema),handler.medicineupdate)
router.post('/find',expressJoi(med_find_schema),handler.medicinefind)
module.exports=router